#!/bin/bash
set -e

cd $(dirname $0)/..

echo Running tests

PACKAGES="$(find . -name '*.go' | xargs -I{} dirname {} | sort -u | grep -Ev '(.git|.trash-cache|vendor|bin)')"

echo Packages: ${PACKAGES}

[ "${ARCH}" == "amd64" ] && RACE=-race
go test ${RACE} -cover ${PACKAGES}
